package org.mule.transport.ftpext.config;

import org.mule.transport.ftpext.FtpExtConnector;
import org.mule.config.spring.handlers.AbstractMuleNamespaceHandler;
import org.mule.config.spring.parsers.generic.ChildDefinitionParser;
import org.mule.endpoint.URIBuilder;
import org.mule.transport.file.ExpressionFilenameParser;
import org.mule.transport.file.FilenameParser;
//import org.mule.transport.ftp.FtpConnector;

/**
 * Reigsters a Bean Definition Parser for handling <code><ftp:connector></code> elements.
 */
public class FtpExtNamespaceHandler extends AbstractMuleNamespaceHandler
{
    @Override
    public void init()  
    {
        registerStandardTransportEndpoints("ftpext"/*FtpConnector.FTP*/, URIBuilder.SOCKET_ATTRIBUTES);
        registerConnectorDefinitionParser(FtpExtConnector.class);

        registerBeanDefinitionParser("custom-filename-parser", new ChildDefinitionParser("filenameParser", null, FilenameParser.class));
        registerBeanDefinitionParser("expression-filename-parser", new ChildDefinitionParser("filenameParser", ExpressionFilenameParser.class));
    }
}